package com.stockz.equity.indicator.vsa.pattern;

import java.util.List;

import org.springframework.stereotype.Component;

import com.stockz.equity.indicator.vsa.VsaBar;
import com.stockz.equity.indicator.vsa.property.Region;
import com.stockz.equity.indicator.vsa.property.Type;
import com.stockz.equity.indicator.vsa.property.Volume;
import com.stockz.equity.model.Bar;

@Component
public class SellingClimax extends VsaPattern {

	public SellingClimax() {
		super("SC", "Selling Climax", VsaPatternType.Bullish);
	}

	@Override
	public void analyze(List<Bar> barList,List<VsaBar> vsaBarList, int index) {
		VsaBar vsaBar = vsaBarList.get(index);
		if(Region.OverSold.equals(vsaBar.getRegion())
			&& Type.Down.equals(vsaBar.getType())
			//&& Close.Low.equals(vsaBar.getClose())   //what's the rational behind this?
			//&& Spread.Wide.equals(vsaBar.getSpread())  //Doubt it
			&& (Volume.UltraHigh.equals(vsaBar.getVolume())
				|| Volume.Climatic.equals(vsaBar.getVolume()))){
			vsaBar.getVsaPatternList().add(this);
		}
	}
}
